﻿using System;
using System.Collections.Generic;
using System.Data.SqlClient;

namespace CaltechSoft.Service.SearchCriteria
{
  public class SearchCriteria
  {
    public string Keyword { get; set; }

    private readonly IDictionary<string, SearchSortItem> _sortItems;
    public IEnumerable<SearchSortItem> SortItems
    {
      get { return _sortItems.Values; }
    }

    public SearchCriteria()
    {
      _sortItems = new Dictionary<string, SearchSortItem>();
    }

    public SearchCriteria AddSortOrder(string field, SortOrder order)
    {
      if (!_sortItems.ContainsKey(field)) _sortItems.Add(field, new SearchSortItem(field, order));
      return this;
    }
  }

}
